﻿<?xml version="1.0" encoding="utf-8" ?>
<FieldTypes>
	<FieldType>
		<Field Name="TypeName">AdvancedLookupField</Field>
		<Field Name="TypeDisplayName">Advanced Lookup Field</Field>
		<Field Name="TypeShortDescription">Advanced Lookup Field</Field>
		<Field Name="ParentType">Lookup</Field>
		<Field Name="FieldTypeClass">WMOSSExperts.Fields.AdvancedLookupField, WMOSSExperts.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1e2e309413357b67</Field>
		<Field Name="FieldEditorUserControl">/_controltemplates/AdvancedLookupFieldEditor.ascx</Field>
		<Field Name="Sortable">TRUE</Field>
		<Field Name="Filterable">TRUE</Field>
		<Field Name="AllowBaseTypeRendering">TRUE</Field>
		<PropertySchema>
			<Fields>
				<Field Name="ReverseLookupGuid" DisplayName="Reverse lookup field Guid" Type="Text" Hidden="TRUE" />
				<Field Name="RelatedLookupLinkFieldGuid" DisplayName="Related Lookup Link field Guid" Type="Text" Hidden="TRUE" />
				<Field Name="FilteredViewGuid" DisplayName="Filtered View Guid" Type="Text" Hidden="TRUE" />
				<Field Name="AdditionalFields" DisplayName="Additional Fields" Type="Note" Hidden="TRUE" />
			</Fields>
		</PropertySchema>
		<RenderPattern Name="HeaderPattern">
			<Switch>
				<Expr>
					<Property Select='Filterable'/>
				</Expr>
				<Case Value="FALSE"> </Case>
				<Default>
					<Switch>
						<Expr>
							<GetVar Name='Filter'/>
						</Expr>
						<Case Value='1'>
							<HTML><![CDATA[<SELECT ID="diidFilter]]></HTML>
							<Property Select='Name'/>
							<HTML>                  <![CDATA[" TITLE=]]></HTML>
							<HTML>"$Resources:core,501;</HTML>
							<Property Select='DisplayName' HTMLEncode='TRUE'/>
							<HTML><![CDATA[" OnChange='FilterField("]]></HTML>
							<GetVar Name="View"/>
							<HTML><![CDATA[",]]></HTML>
							<ScriptQuote>
								<Property Select='Name' URLEncode="TRUE"/>
							</ScriptQuote>
							<HTML><![CDATA[,this.options[this.selectedIndex].value, this.selectedIndex);' dir="]]></HTML>
							<Property Select="Direction" HTMLEncode="TRUE"/>
							<HTML><![CDATA[">]]></HTML>
							<FieldFilterOptions BooleanTrue="$Resources:core,fld_yes;" BooleanFalse="$Resources:core,fld_no;" NullString="$Resources:core,fld_empty;" AllItems="$Resources:core,fld_all;"></FieldFilterOptions>
							<HTML><![CDATA[</SELECT><BR>]]></HTML>
						</Case>
					</Switch>
				</Default>
			</Switch>
			<Switch>
				<Expr>
					<Property Select='Sortable'/>
				</Expr>
				<Case Value="FALSE">
					<Property Select='DisplayName' HTMLEncode="TRUE"/>
				</Case>
				<Default>
					<Switch>
						<Expr>
							<GetVar Name='SortDisable'/>
						</Expr>
						<Case Value='TRUE'>
							<Property Select='DisplayName' HTMLEncode="TRUE"/>
						</Case>
						<Default>
							<HTML><![CDATA[<A ID="diidSort]]></HTML>
							<Property Select='Name'/>
							<HTML>        <![CDATA[" onfocus="OnFocusFilter(this)" TITLE=]]></HTML>
							<HTML>"$Resources:core,500;</HTML>
							<Property Select='DisplayName' HTMLEncode='TRUE'/>
							<HTML><![CDATA[" HREF="javascript:" OnClick="javascript:return OnClickFilter(this,event);" ]]></HTML>
							<HTML><![CDATA[ SORTINGFIELDS="]]></HTML>
							<FieldSortParams HTMLEncode="TRUE"/>
							<HTML><![CDATA[">]]></HTML>
							<Property Select='DisplayName' HTMLEncode="TRUE"/>
							<HTML><![CDATA[<img src="/_layouts/images/blank.gif" class="ms-hidden" border=0 width=1 height=1 alt="]]></HTML>
							<HTML>$Resources:OpenMenuKeyAccessible;</HTML>
							<HTML><![CDATA[">]]></HTML>
							<HTML><![CDATA[</A><IMG SRC="]]></HTML>
							<FieldSortImageURL/>
							<HTML><![CDATA[" ALT="]]></HTML>
							<Switch>
								<Expr>
									<GetVar Name='SortDir'/>
								</Expr>
								<Case Value='Asc'>
									<HTML>$Resources:core,150;</HTML>
								</Case>
								<Case Value='Desc'>
									<HTML>$Resources:core,151;</HTML>
								</Case>
								<Default>
									<HTML></HTML>
								</Default>
							</Switch>
							<HTML><![CDATA[" BORDER=0>]]></HTML>
						</Default>
					</Switch>
				</Default>
			</Switch>
			<HTML><![CDATA[<IMG SRC="]]></HTML>
			<FieldFilterImageURL/>
			<HTML><![CDATA[" BORDER=0 ALT="">]]></HTML>
		</RenderPattern>
		<RenderPattern Name="DisplayPattern">
			<FieldSwitch>
				<Expr>
					<Property Select="FieldRef"/>
				</Expr>
				<Case Value="">
					<FieldSwitch>
						<Expr>
							<Property Select="CountRelated"/>
						</Expr>
						<Case Value="TRUE">
							<!--
							OOTB CAML tags don't always render correctly the url of cross lookup						   
							<HTML><![CDATA[<A HREF="]]></HTML>
							<UrlDirName>
								<URL Cmd="Lookup"/>
							</UrlDirName>
							<HTML>/ViewBy</HTML>
							<ListProperty Select="Title"></ListProperty>
							<HTML>.aspx?Value=</HTML>
							<Column HTMLEncode='TRUE' Name='ID' Default='0'></Column>
							<HTML><![CDATA[">]]></HTML>
							<LookupColumn HTMLEncode="TRUE"/>
							<HTML><![CDATA[</A>]]></HTML>
							-->
							<HTML><![CDATA[<A HREF="]]></HTML>
							<HttpVDir/>
							<HTML><![CDATA[/_layouts/WMOSSExperts/RoutingRequest.aspx?Route=ViewRelatedItems&Source=]]></HTML>
							<ListUrlDir ServerRel="TRUE" URLEncodeAsURL="TRUE"/>
							<HTML><![CDATA[&FieldID=]]></HTML>
							<Property Select="ID" URLEncode="TRUE" />
							<HTML><![CDATA[&Value=]]></HTML>
							<Column HTMLEncode='TRUE' Name='ID' Default='0'></Column>
							<HTML><![CDATA[" />]]></HTML>
							<LookupColumn HTMLEncode="TRUE"/>
							<HTML><![CDATA[</A>]]></HTML>
						</Case>
						<Default>
							<Switch>
								<Expr>
									<Column/>
								</Expr>
								<Case Value="">
								</Case>
								<Default>
									<FieldSwitch>
										<Expr>
											<Property Select="LookupType"/>
										</Expr>
										<Case Value="Computed">
											<LookupColumn/>
										</Case>
										<Default>
											<!--
											OOTB CAML tags add rootfolder in the query string which is not compatible
											with the rendering view of the team discussion						   
											<HTML><![CDATA[<A HREF="]]></HTML>
											<URL Cmd="Lookup"/>
											<HTML><![CDATA[">]]></HTML>
											<LookupColumn HTMLEncode="TRUE"/>
											<HTML><![CDATA[</A>]]></HTML>
											-->
											<HTML><![CDATA[<A HREF="]]></HTML>
											<HttpVDir/>
											<HTML><![CDATA[/_layouts/WMOSSExperts/RoutingRequest.aspx?Route=ViewParentItem&Source=]]></HTML>
											<ListUrlDir ServerRel="TRUE" URLEncodeAsURL="TRUE"/>
											<HTML><![CDATA[&FieldID=]]></HTML>
											<Property Select="ID" URLEncode="TRUE" />
											<HTML><![CDATA[&Value=]]></HTML>
											<Column HTMLEncode='TRUE' Default='0' />
											<HTML><![CDATA[" />]]></HTML>
											<LookupColumn HTMLEncode="TRUE"/>
											<HTML><![CDATA[</A>]]></HTML>
										</Default>
									</FieldSwitch>
								</Default>
							</Switch>
						</Default>
					</FieldSwitch>
				</Case>
				<Default>
					<LookupColumn HTMLEncode="TRUE"/>
				</Default>
			</FieldSwitch>
		</RenderPattern>
		<RenderPattern Name="EditPattern">
			<HTML><![CDATA[<SCRIPT>fld = new Field(frm,]]></HTML>
			<ScriptQuote>
				<Property Select="Name"/>
			</ScriptQuote>
			<HTML>,</HTML>
			<ScriptQuote>
				<Property Select="DisplayName"/>
			</ScriptQuote>
			<HTML><![CDATA[);</SCRIPT>]]></HTML>
			<HTML><![CDATA[<SELECT TITLE="]]></HTML>
			<Property Select="DisplayName"/>
			<HTML><![CDATA[" TABINDEX=1 NAME="]]></HTML>
			<FieldPrefix/>
			<Property Select="Name"/>
			<HTML><![CDATA[">]]></HTML>
			<Switch>
				<Expr>
					<Property Select="Required"/>
				</Expr>
				<Case Value="TRUE">
				</Case>
				<Default>
					<HTML><![CDATA[<OPTION Value="">]]></HTML>
					<HTML>$Resources:core,onetfldtypes03;</HTML>
					<HTML><![CDATA[</OPTION>]]></HTML>
				</Default>
			</Switch>
			<SelectOptions  Len="100" MoreText="..."/>
			<HTML><![CDATA[</SELECT>]]></HTML>
		</RenderPattern>
		<RenderPattern Name="NewPattern" DisplayName="NewPattern">
			<HTML><![CDATA[<SCRIPT>fld = new Field(frm,]]></HTML>
			<ScriptQuote>
				<Property Select="Name"/>
			</ScriptQuote>
			<HTML>,</HTML>
			<ScriptQuote>
				<Property Select="DisplayName"/>
			</ScriptQuote>
			<HTML><![CDATA[);</SCRIPT>]]></HTML>
			<HTML><![CDATA[<SELECT TABINDEX=1 NAME="]]></HTML>
			<FieldPrefix/>
			<Property Select="Name"/>
			<HTML><![CDATA[">]]></HTML>
			<Switch>
				<Expr>
					<Property Select="Required"/>
				</Expr>
				<Case Value="TRUE">
				</Case>
				<Default>
					<HTML><![CDATA[<OPTION Value="">]]></HTML>
					<HTML>$Resources:core,onetfldtypes03;</HTML>
					<HTML><![CDATA[</OPTION>]]></HTML>
				</Default>
			</Switch>
			<SelectOptions Len="100" MoreText="..."/>
			<HTML><![CDATA[</SELECT>]]></HTML>
		</RenderPattern>
		<RenderPattern Name="PreviewDisplayPattern">
			<HTML><![CDATA[["]]></HTML>
			<Property Select="DisplayName" HTMLEncode="TRUE"/>
			<HTML>"$Resources:core,fldtypes011;</HTML>
		</RenderPattern>
		<RenderPattern Name="PreviewEditPattern">
			<Switch>
				<Expr>
					<Property Select="Format"/>
				</Expr>
				<Case Value="RadioButtons">
					<HTML><![CDATA[<table cellpadding="0" cellspacing="1">]]></HTML>
					<SetVar Name="_ChoiceDefault">
						<Property Select="Default"/>
					</SetVar>
					<ForEach Select="CHOICES/CHOICE">
						<HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"]]></HTML>
						<IfEqual>
							<Expr1>
								<Property Select="."/>
							</Expr1>
							<Expr2>
								<GetVar Name="_ChoiceDefault"/>
							</Expr2>
							<Then>
								<HTML><![CDATA[ checked]]></HTML>
							</Then>
						</IfEqual>
						<HTML><![CDATA[></td><td class="ms-RadioText" vAlign="top">]]></HTML>
						<Property Select="." HTMLEncode="TRUE"/>
						<HTML><![CDATA[</td></tr>]]></HTML>
					</ForEach>
					<Switch>
						<Expr>
							<Property Select="FillInChoice"/>
						</Expr>
						<Case Value="TRUE">
							<HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
							<HTML>$Resources:core,fldtypes018;</HTML>
							<HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr>]]></HTML>
						</Case>
					</Switch>
					<HTML><![CDATA[</table>]]></HTML>
				</Case>
				<Default>
					<Switch>
						<Expr>
							<Property Select="FillInChoice"/>
						</Expr>
						<Case Value="TRUE">
							<HTML><![CDATA[<table><tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
							<HTML><![CDATA[<select><option selected>"]]></HTML>
							<Property Select="DisplayName" HTMLEncode="TRUE"/>
							<HTML>"$Resources:core,fldtypes012;</HTML>
							<HTML><![CDATA[</option></select>]]></HTML>
							<HTML><![CDATA[</td></tr>]]></HTML>
							<HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
							<HTML>$Resources:core,fldtypes018;</HTML>
							<HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr></table>]]></HTML>
						</Case>
						<Default>
							<HTML><![CDATA[<select><option selected>"]]></HTML>
							<Property Select="DisplayName" HTMLEncode="TRUE"/>
							<HTML>"$Resources:core,fldtypes012;</HTML>
							<HTML><![CDATA[</option></select>]]></HTML>
						</Default>
					</Switch>
				</Default>
			</Switch>
		</RenderPattern>
		<RenderPattern Name="PreviewNewPattern">
			<Switch>
				<Expr>
					<Property Select="Format"/>
				</Expr>
				<Case Value="RadioButtons">
					<HTML><![CDATA[<table cellpadding="0" cellspacing="1">]]></HTML>
					<SetVar Name="_ChoiceDefault">
						<Property Select="Default"/>
					</SetVar>
					<ForEach Select="CHOICES/CHOICE">
						<HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"]]></HTML>
						<IfEqual>
							<Expr1>
								<Property Select="."/>
							</Expr1>
							<Expr2>
								<GetVar Name="_ChoiceDefault"/>
							</Expr2>
							<Then>
								<HTML><![CDATA[ checked]]></HTML>
							</Then>
						</IfEqual>
						<HTML><![CDATA[></td><td class="ms-RadioText" vAlign="top">]]></HTML>
						<Property Select="." HTMLEncode="TRUE"/>
						<HTML><![CDATA[</td></tr>]]></HTML>
					</ForEach>
					<Switch>
						<Expr>
							<Property Select="FillInChoice"/>
						</Expr>
						<Case Value="TRUE">
							<HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
							<HTML>$Resources:core,fldtypes018;</HTML>
							<HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr>]]></HTML>
						</Case>
					</Switch>
					<HTML><![CDATA[</table>]]></HTML>
				</Case>
				<Default>
					<Switch>
						<Expr>
							<Property Select="FillInChoice"/>
						</Expr>
						<Case Value="TRUE">
							<HTML><![CDATA[<table><tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
							<HTML><![CDATA[<select><option selected>"]]></HTML>
							<Property Select="DisplayName" HTMLEncode="TRUE"/>
							<HTML>"$Resources:core,fldtypes012;</HTML>
							<HTML><![CDATA[</option></select>]]></HTML>
							<HTML><![CDATA[</td></tr>]]></HTML>
							<HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
							<HTML>$Resources:core,fldtypes018;</HTML>
							<HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr></table>]]></HTML>
						</Case>
						<Default>
							<HTML><![CDATA[<select><option selected>"]]></HTML>
							<Property Select="DisplayName" HTMLEncode="TRUE"/>
							<HTML>"$Resources:core,fldtypes012;</HTML>
							<HTML><![CDATA[</option></select>]]></HTML>
						</Default>
					</Switch>
				</Default>
			</Switch>
		</RenderPattern>
	</FieldType>
	<FieldType>
		<Field Name="TypeName">RelatedLookupLinksField</Field>
		<Field Name="TypeDisplayName">Related Lookup Links Field</Field>
		<Field Name="TypeShortDescription">Related Lookup links Field description</Field>
		<Field Name="ParentType">Boolean</Field>
		<Field Name="FieldTypeClass">WMOSSExperts.Fields.RelatedLookupLinksField, WMOSSExperts.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1e2e309413357b67</Field>
		<Field Name="FieldEditorUserControl">/_controltemplates/RelatedLookupLinksFieldEditor.ascx</Field>
		<Field Name="Sortable">FALSE</Field>
		<Field Name="Filterable">FALSE</Field>
		<Field Name="UserCreatable">FALSE</Field>
		<PropertySchema>
			<Fields>
				<Field Name="LookupLinks" DisplayName="Lookup Links" Type="Note" Hidden="TRUE" />
			</Fields>
		</PropertySchema>
	</FieldType>
</FieldTypes>